package com.starlink.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import org.springframework.data.domain.Pageable;
import com.starlink.model.domain.MallPeripherySpecificationDO;
import com.starlink.model.request.MallPeripherySpecificationRequest;
import com.starlink.model.vo.MallPeripherySpecificationVO;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author zhanghong
 */
public interface MallPeripherySpecificationService extends IService<MallPeripherySpecificationDO> {

    /**
     * 根据主键查询
     * @param id
     * @return
     */
    MallPeripherySpecificationVO getByKey(long id);
    /**
     * 分页查询，手动分页
     * @param request
     * @return
     */
    PageInfo<MallPeripherySpecificationVO> pageQuery(Pageable pageable,MallPeripherySpecificationRequest request);
    /**
     * 列表查询
     * @param request
     * @return
     */
    List<MallPeripherySpecificationVO> listQuery(MallPeripherySpecificationRequest request);
    /**
     * 新增
     * @param request
     * @return
     */
    Boolean add(MallPeripherySpecificationRequest request);
    /**
     * 根据主键更新
     * @param request
     * @return
     */
    Boolean updateByKey(MallPeripherySpecificationRequest request);
    /**
     * 根据主键删除
     * @param ids
     * @return
     */
    Boolean deleteDOByIds(String ids);

    /**
     * 新增规格
     * @param specification
     */
    void saveBatch(List<MallPeripherySpecificationDO> specification);

    /**
     * 根据周边商品ID
     * @param perId
     */
    void deletedByPerId(Long perId);

    /**
     * 根据周边商品ID查询价格最低的规格的价格
     * @param itemId
     * @return
     */
    MallPeripherySpecificationVO selectFirstByPeripheryId(Long itemId);

    void updateQuantity(Map<String, Long> quantityMap);

    void deletedByPerIds(String ids);

    void addQuantity(Map<String, Long> map);
}
